<?php

namespace App\Admin\Actions\Grid\Row\SwtProcurement;

use App\Admin\Views\SwtProcurement\SwtProcurementView;
use App\Admin\Views\SwtProcurement\SwtReplenishmentView;
use Dcat\Admin\Grid\RowAction;
use Dcat\Admin\Widgets\Modal;

class ReplenishmentDetail extends RowAction
{
    /**
     * @return string
     */
    protected $title = '补货单详情';


    public function render()
    {
        $title = '补货单详情 - '. $this->row->id;

        $button = <<<HTML
            <a><i class="feather icon-eye text-success"></i> <span class="text-success">{$this -> title}</span> &emsp;</a>
        HTML;

        $id = $this->getKey();

        return Modal::make()
            ->xl()
            ->title($title)
            ->body(new SwtReplenishmentView(['id'=>$id]))
            ->button($button);
    }

}
